﻿@model DLULearningNetwork.ViewModels.AdminAccountViewModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_BackendLayout.cshtml";
}
@section cssjs{
    <script type="text/javascript" src="../../Scripts/Custom/jsAdminAccount.js"></script>
}

<h2>
    Danh sách tài khoản</h2>
<div>
    <div class="loading">
    </div>
    <table class="tbl1" cellpadding="0" cellspacing="0">
        <tr>
            <th>
                Nickname
            </th>
            <th>
                Họ
            </th>
            <th>
                Tên
            </th>
            <th>
                Email
            </th>
            <th>
                Trạng thái
            </th>
            <th>
                Thao tác
            </th>
        </tr>
        @for (int i = 0; i < Model.Accounts.Count; i++)
        {
            <tr @if (i % 2 != 0)
                {@MvcHtmlString.Create("class=\"odd\"")} accountID="@Model.Accounts[i].AccountID_u">
                <td>@Model.Accounts[i].Nickname_s
                </td>
                <td>@Model.Accounts[i].LastName_s
                </td>
                <td>@Model.Accounts[i].FirstName_s
                </td>
                <td>@Model.Accounts[i].Email_s
                </td>
                <td>
                    @if (!Model.Accounts[i].IsBanned_b.HasValue || !Model.Accounts[i].IsBanned_b.Value) 
                    { 
                        @MvcHtmlString.Create("Đang hoạt động")
                    }
                    else
                    {
                        @MvcHtmlString.Create("Đã bị khóa")
                    }
                </td>
                <td>
                    @if (!Model.Accounts[i].IsBanned_b.HasValue || !Model.Accounts[i].IsBanned_b.Value)
                    {
                        <span style="cursor: pointer;" class="ban_icon16">Ban account</span>
                    }
                    else
                    {
                        <span style="cursor: pointer;" class="unban_icon16">Unbanned account</span>
                    }
                </td>
            </tr>
        }
    </table>
    <div class="pagination pagination-left" style="margin-left: 3px;">
        <ul class="pager">
            @Html.Partial("UCPager2", new DLULearningNetwork.ViewModels.PagerViewModel2(Model.TotalItems, Model.PageSize,
    Model.ItemsPerPages, Model.CurrentPage, Request.Url.AbsoluteUri))
        </ul>
    </div>
</div>
